package com.tgpms.web.cost.service.impl;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.tgpms.common.Result;
import com.tgpms.exception.ExceptionExplain;
import com.tgpms.interfaces.dto.VformInterface;
import com.tgpms.util.VformBeanUtil;
import com.tgpms.web.cost.service.SubProjectsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.HashMap;
import java.util.Map;

/**
 * @ClassName SubProjectsServiceImpl
 * @Description TODO
 * @Author GUAN
 * @Date 2019-8-23 17:33
 * @Version 1.0
 * @return
 **/
@Service
@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, rollbackFor = Exception.class)
public class SubProjectsServiceImpl implements SubProjectsService {

    @Autowired
    private VformInterface vformInterface;

    @Override
    public Result querySubProject(String subProject, String dataOwner) {
        Result result = new Result();
        Map<String,String> map = new HashMap<String, String>();
        map.put("sub_project",subProject);
        String dataString = JSON.toJSONString(map);
        result = vformInterface.find("D1023",dataString,"1","100","Y","Y",dataOwner);
        return result;
    }
}
